package com.tedu.demo;

import com.sun.xml.internal.bind.v2.model.core.ID;

//测试内部类
public class Test04 {

    public static void main(String[] args) {
        float f = (float) 1.1;
        String  str1="java";String  str2="java";
        System.out.println(str1==str2);
        //匿名内部类
//        Inter inter = new Inter(){
//
//            @Override
//            public void save() {
//                System.out.println("save()");
//            }
//        };
//        inter.save();

        //下面的方法只适用接口内于一个抽象方法
        //无参
        Inter inter = () -> { System.out.println("LAMBDE1"); };
        inter.save();
        //有参
        Inter1 inter1 = (int id) -> { System.out.println("LAMBDE2" + id); };
        inter1.save(20);

        //有参有返回值
        //Inter2 inter2 = (String a, int b) -> { return a+b; };
        //System.out.println(inter2.get("张安",20));
    }
}
interface Inter{
    void save();
}
interface Inter1{
    void save(int id);

}
interface Inter2{
    String get(String name,int age);
}
